package com.uetoken.cn.adapter.holder;

import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.uetoken.cn.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class UserTransferHolder {

    @BindView(R.id.accountEt)
    public EditText mAccountEt;
    @BindView(R.id.verifyBtn)
    public Button mVerifyBtn;
    @BindView(R.id.userNameTv)
    public TextView mUserNameTv;
    @BindView(R.id.userPhoneNumberTv)
    public TextView mUserPhoneNumberTv;
    @BindView(R.id.amountEnteredEt)
    public EditText mAmountEnteredEt;
    @BindView(R.id.delIv)
    public ImageView mDelIv;
    @BindView(R.id.availableBalanceValTv)
    public TextView mAvailableBalanceValTv;
    @BindView(R.id.allTransferTv)
    public TextView mAllTransferTv;
    @BindView(R.id.accountInfoLayout)
    public LinearLayout mAccountInfoLayout;
    @BindView(R.id.availableBalanceLayout)
    public RelativeLayout mAvailableBalanceLayout;
    @BindView(R.id.currentExchangeRateLayout)
    public RelativeLayout currentExchangeRateLayout;
    @BindView(R.id.currentExchangeRateEt)
    public TextView currentExchangeRateEt;
    @BindView(R.id.amountEnteredLayout)
    public LinearLayout amountEnteredLayout;
    @BindView(R.id.unitLayout)
    public LinearLayout unitLayout;
    @BindView(R.id.monetaryAllTv)
    public TextView monetaryAllTv;
    @BindView(R.id.monetaryUnitTv)
    public TextView monetaryUnitTv;


    private OnSingleTransferClickListener mOnSingleTransferClickListener;

    public interface OnSingleTransferClickListener {
        void onCheckAccountClick(View view);

        void onDeleteAmountClick(View view);

        void onFullAmountClick(View view);
    }

    public void setOnSingleTransferClickListener(OnSingleTransferClickListener mOnSingleTransferClickListener) {
        this.mOnSingleTransferClickListener = mOnSingleTransferClickListener;
    }

    public UserTransferHolder(View view) {
        ButterKnife.bind(this, view);
    }

    @OnClick({R.id.verifyBtn, R.id.delIv, R.id.allTransferTv, R.id.monetaryAllTv})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.verifyBtn:
                if (mOnSingleTransferClickListener != null) {
                    mOnSingleTransferClickListener.onCheckAccountClick(view);
                }
                break;
            case R.id.delIv:
                if (mOnSingleTransferClickListener != null) {
                    mOnSingleTransferClickListener.onDeleteAmountClick(view);
                }
                break;
            case R.id.monetaryAllTv:
            case R.id.allTransferTv:
                if (mOnSingleTransferClickListener != null) {
                    mOnSingleTransferClickListener.onFullAmountClick(view);
                }
                break;
        }
    }

}
